const express = require('express')
const {validate} = require('express-validation')
const Ctrl = require("../controller/Cate")
const CateSchema = require("../schema/Cate")

const Router = express.Router()

Router.get("/", Ctrl.getCates)
Router.post("/add", validate(CateSchema.addCate), Ctrl.addCate)
Router.get("/:cateId", validate(CateSchema.cateId), Ctrl.deleteCate)
Router.post("/update", validate(CateSchema.updateCateById), Ctrl.updateCateById)

module.exports = Router